package com.itheima.staticMethod;

public class verifyCodeUtil {
    private verifyCodeUtil() {}
    public static String getCode(int n){
        String code = "";
        for (int i = 0; i < n; i++) {
            int type = (int)(Math.random() * 3); //  数字0, 大写1, 小写2
            switch (type) {
                case 0:
                    code += (int)(Math.random() * 10);
                    break;

                case 1:
                    code += (char)(Math.random() * 26 + 'A');
                    break;

                case 2:
                    code += (char)(Math.random() * 26 + 'a');
                    break;
            }
        }
        return code;
    }
}
